@extends('layouts.system')

@section('css')
    <style type="text/css">
        .infoItem {
            margin: 10px 0;
            line-height: 18px;
        }

        .infoItem .desc {
            width: 250px;
            font-size: 18px;
            color: #000;
        }

        .infoItem .stateValue {
            font-size: 18px;
            color: #012aff;
            text-decoration: underline;
        }

        .infoItem .value {
            font-size: 18px;
        }

        .modal-backdrop {
            z-index: 1030;
        }
    </style>
@endsection

@section('content')

    <div id="cl-wrapper" class="fixed-menu">
        <div class="container-fluid" id="pcont">
            <div class="col-md-12" style="padding-right: 0;">
                <div class="block-flat">
                    <div class="header">
                        <div class="pull-left">
                            <p class="jb_underline">企业申请&#62;&#62;详情资料</p>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                    <div class="content">
                        <div class="row">
                            <div class="col-sm-12 infoItem">
                                <div class="col-sm-3 desc">企业名称：</div>
                                <div class="col-sm-9 value">
                                    {{$details['company_name']}}
                                </div>
                            </div>
                            <div class="col-sm-12 infoItem">
                                <div class="col-sm-3 desc">联系人：</div>
                                <div class="col-sm-9 value">
                                    {{$details['contact_man']}}
                                </div>
                            </div>
                            <div class="col-sm-12 infoItem">
                                <div class="col-sm-3 desc">联系方式：</div>
                                <div class="col-sm-9 value">
                                    {{$details['contact_way']}}
                                </div>
                            </div>
                            <div class="col-sm-12 infoItem">
                                <div class="col-sm-3 desc">上传企业营业执照：</div>
                                <div class="col-sm-9 value">
                                    <a data-toggle="lightbox" href="#Lightbox">
                                        查看
                                    </a>
                                    <div id="Lightbox" class="lightbox fade" tabindex="-1" role="dialog" aria-hidden="true">
                                        <div class='lightbox-dialog'>
                                            <div class='lightbox-content'>
                                                <img src="{{$details['business_license']}}">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-12 infoItem">
                                <div class="col-sm-3 desc">希望发布的任务类型：</div>
                                <div class="col-sm-9 value">
                                    {{$details['release_type']}}
                                </div>
                            </div>
                            <div class="col-sm-12 infoItem">
                                <div class="col-sm-3 desc">希望的目标群体类型：</div>
                                <div class="col-sm-9 value">
                                    {{$details['target_throng']}}
                                </div>
                            </div>
                            <div class="col-sm-12 infoItem">
                                <div class="col-sm-3 desc">备注信息：</div>
                                <div class="col-sm-9 value">
                                    {!! $details['remark'] !!}
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div style="margin: 50px 0 0 120px;">
                                <a href="/admin/company" class="btn btn-primary">返回</a>
                                <button v-on:click="del()" class="btn btn-danger">删除</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

@endsection

@section('script')
    <script type="text/javascript">

        Vue.use(VueResource)
        var app = new Vue({
          el: '#pcont',
          data: {
          },
          methods : {
            del : function(){
                if (confirm('是否删除该企业申请？')) {
                    del(this,{{$details['id']}})
                }
            }
          }
        })

        function del(_vm,id) {
            _vm.$http.post("/admin/company/delete/" + id, {}, {headers: header()})
                .then(function (response) {
                    var json = response.body;
                    if (json.state == 1) {
                        alert(json.msg)
                        window.location.href = '/admin/company'
                    }
                }).catch(function (response) {
                console.log(response)
            })
        }

    </script>
@endsection